﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Numbers;
using System.ComponentModel;

namespace System8ToyMC
{
	public partial class EfficiencyUC : UserControl
	{
		public EfficiencyUC()
		{
			// Required to initialize variables
			InitializeComponent();
            LayoutRoot.DataContext = this;
		}

        [Category("Numbers")]
        [Description("The efficiency data we are showing")]
        public TagEfficiency Efficiency
        {
            get { return (TagEfficiency)GetValue(EfficiencyProperty); }
            set { SetValue(EfficiencyProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Efficiency.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty EfficiencyProperty =
            DependencyProperty.Register("Efficiency", typeof(TagEfficiency), typeof(EfficiencyUC), new PropertyMetadata(null));

        [Category("Numbers")]
        [Description("The name of this efficency")]
        public string EfficiencyName
        {
            get { return (string)GetValue(EfficiencyNameProperty); }
            set { SetValue(EfficiencyNameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for EfficiencyName.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty EfficiencyNameProperty =
            DependencyProperty.Register("EfficiencyName", typeof(string), typeof(EfficiencyUC), new PropertyMetadata("eff LT:"));


        [Category("Numbers")]
        [Description("The derived charm/light efficiency")]
        public epsilon_12 EpsilonCL
        {
            get { return (epsilon_12)GetValue(EpsilonCLProperty); }
            set { SetValue(EpsilonCLProperty, value); }
        }

        // Using a DependencyProperty as the backing store for EpsilonCL.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty EpsilonCLProperty =
            DependencyProperty.Register("EpsilonCL", typeof(epsilon_12), typeof(EfficiencyUC), new PropertyMetadata(null));

        private string _path;

        /// <summary>
        /// Get?Set the path to this variable
        /// </summary>
        public string Path
        {
            get { return _path; }
            set
            {
                _path = value;
                TBEffB.Path = _path + "/eff_bValue";
                TBEffC.Path = _path + "/eff_cValue";
                TBEffL.Path = _path + "/eff_lValue";
                TBEPSCL.Path = _path + "_cl/ValueValue";
            }
        }
    }
}